#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
void sigcb(int signo){
  printf("我是%d号信号\n", signo);
}
int main(){
  struct sigaction act;
  memset(&act, 0, sizeof(act));

  act.sa_handler = sigcb;//执行自定义动作

  
  sigaction(2, &act, NULL);
  sleep(20);
  return 0;
}

